import random
ran=random.randint(1,150)
money=5000
print(ran)
print("===========开始游戏============")
print("====请输入0~150之间的任意数字====")
for i in range(15):
    num=int(input("请输入一个数："))
    if num==ran:
        money = money + 3000
        print("猜对了")
        print("当前金币数量为：%d" % money)
    elif num > ran:
        money = money - 500
        print("猜大了")
        print("当前金币数量为：%d" % money)
    elif num < ran:
        money = money - 500
        print("猜小了")
        print("当前金币数量为：%d" % money)
        continue
print("====游戏结束====")
print("金币数量：%f" %money)